import request from '@/utils/request';

// 获取飘窗信息
export function reqGetImgList() {
    return request({
        url: '/drug/bayWindow/get',
        method: 'get'
    })
}

// 新增 || 修改
export function reqAddOrEdit(data) {
    // 判断是否携带id，如果携带调用修改接口，否则新增
    if (data.id) {
        return request({
            url: '/drug/bayWindow/update',
            method: 'put',
            data
        })
    } else {
        return request({
            url: '/drug/bayWindow/add',
            method: 'post',
            data
        })
    }
}

// 根据id删除飘窗信息
export function reqDelete(id) {
    return request({
        url: `/drug/bayWindow/delete/${id}`,
        method: 'delete'
    })
}